package com.groupers;

import com.facebook.react.ReactActivity;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.microsoft.codepush.react.CodePush;

import java.util.Arrays;
import java.util.List;

import javax.annotation.Nullable;

public class MainActivity extends ReactActivity {
    private CodePush mCodePush;

    @Nullable
    @Override
    protected String getJSBundleFile() {
        return mCodePush.getBundleUrl("index.android.bundle");
    }

    /**
     * Returns the name of the main component registered from JavaScript.
     * This is used to schedule rendering of the component.
     */
    @Override
    protected String getMainComponentName() {
        return "Groupers";
    }

    /**
     * Returns whether dev mode should be enabled.
     * This enables e.g. the dev menu.
     */
    @Override
    protected boolean getUseDeveloperSupport() {
        return BuildConfig.DEBUG;
    }

    /**
     * A list of packages used by the app. If the app uses additional views
     * or modules besides the default ones, add more packages here.
     */
    @Override
    protected List<ReactPackage> getPackages() {
        mCodePush = new CodePush("rdZHg4lDK9kquwJOWJ7KJc7q8ZsY4JX8VEPcg", this, BuildConfig.DEBUG);

        return Arrays.<ReactPackage>asList(
            new MainReactPackage(),
            mCodePush.getReactPackage()
        );
    }
}
